//
//  DeliveryView.m
//  xpkc
//
//  Created by Tiyon on 15/12/8.
//  Copyright © 2015年 TopSage. All rights reserved.
//

#import "DeliveryView.h"

@implementation DeliveryView



- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        //
        [self creatCrouseCenterCartView];
    }
    return self;
}

- (void)creatCrouseCenterCartView{
    self.backgroundColor = [UIColor whiteColor];
    //创建
    UIView *topView = [[UIView alloc]init];

    
    self.defaultAddressBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.cartTable = [[UITableView alloc]initWithFrame:CGRectMake(0, 40, SCREEN_WIDTH, SCREEN_HEIGHT-64-60-40) style:UITableViewStylePlain];

    CGRect top_view_frame;
    CGRect default_frame;
    top_view_frame = CGRectMake(0, 0, SCREEN_WIDTH, 40);
    

    default_frame = CGRectMake(20, 0, SCREEN_WIDTH - 40, 40);

    
    topView.frame = top_view_frame;


    self.defaultAddressBtn.frame = default_frame;
    
    //详细
    topView.backgroundColor = [UIColor colorWithRed:0.98 green:0.98 blue:0.98 alpha:1];
    topView.layer.shadowColor = [UIColor blackColor].CGColor;
    topView.layer.shadowOffset = CGSizeMake(0, 3);
    topView.layer.shadowOpacity = 0.1;
    
    
    [self.defaultAddressBtn setTitle:@"默认收货地址" forState:UIControlStateNormal];
    [self.defaultAddressBtn setTitle:@"取消默认收货地址" forState:UIControlStateSelected];
    self.defaultAddressBtn.titleLabel.font = FONT_SYS_S;
    [self.defaultAddressBtn setTitleColor:UIColorFromRGB(0xff4e4e) forState:UIControlStateNormal];
    
    //添加
    [self addSubview:self.cartTable];
    
    [topView addSubview:self.defaultAddressBtn];

    [self addSubview:topView];

}

@end
